package com.tac.service.mes.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tac.common.result.Result;
import com.tac.dao.mes.QualityReportDao;
import com.tac.pojo.mes.QualityReport;
import com.tac.service.mes.QualityReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class QualityReportServiceImpl implements QualityReportService {

    @Autowired
    private QualityReportDao qualityReportDao;


    //质量报告查询
    public Result<PageInfo<QualityReport>> getList(Integer pageNum,Integer pageSize,String completionOrderNumber, String planNumber, String jobName, String productName, String inspectionLot
            , Date manufactureDateStart, Date manufactureDateEnd, String inspectionItems){
        PageHelper.startPage(pageNum,pageSize);
        List<QualityReport> list = qualityReportDao.getList(completionOrderNumber, planNumber, jobName, productName, inspectionLot, manufactureDateStart, manufactureDateEnd, inspectionItems);
        PageInfo<QualityReport> qualityReportPageInfo = new PageInfo<>(list);
        return Result.success(qualityReportPageInfo);
    }

}
